import React from 'react'
import { Table } from 'antd'
import styles from './K2Table.css'
export default class K2Table extends React.Component {
  constructor () {
    super()
    this.state = {
      data: (() => {
        let arr = []
        for (let i = 0; i < 10; i++) {
          arr.push({
            key: i,
            name: `John Brown${i}`,
            money: '￥300,000.00',
            address: 'New York No. 1 Lake Park'
          })
        }
        return arr
      })(),
      scroll: false
    }
  }
  render () {
    const columns = [{
      title: 'Name',
      dataIndex: 'name',
      width: 100
    }, {
      title: 'Cash Assets',
      className: 'column-money',
      dataIndex: 'money',
      width: 100
    }, {
      title: 'Address',
      dataIndex: 'address'
    }]

    const { data } = this.state
    return (
      <div className={styles['k2table']}>
        <Table
          columns={columns}
          dataSource={data}
          pagination={false}
          size='middle'
          scroll={{ y: 240 }}
          bordered
       />
      </div>
    )
  }
}
